package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiElineUnil2Mapper;
import com.ruoyi.net.domain.ElementBusiElineUnil2;
import com.ruoyi.net.service.IElementBusiElineUnil2Service;

/**
 * 网元-业务-eline-uni-l2Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiElineUnil2ServiceImpl implements IElementBusiElineUnil2Service 
{
    @Autowired
    private ElementBusiElineUnil2Mapper elementBusiElineUnil2Mapper;

    /**
     * 查询网元-业务-eline-uni-l2
     * 
     * @param id 网元-业务-eline-uni-l2主键
     * @return 网元-业务-eline-uni-l2
     */
    @Override
    public ElementBusiElineUnil2 selectElementBusiElineUnil2ById(String id)
    {
        return elementBusiElineUnil2Mapper.selectElementBusiElineUnil2ById(id);
    }

    /**
     * 查询网元-业务-eline-uni-l2列表
     * 
     * @param elementBusiElineUnil2 网元-业务-eline-uni-l2
     * @return 网元-业务-eline-uni-l2
     */
    @Override
    public List<ElementBusiElineUnil2> selectElementBusiElineUnil2List(ElementBusiElineUnil2 elementBusiElineUnil2)
    {
        return elementBusiElineUnil2Mapper.selectElementBusiElineUnil2List(elementBusiElineUnil2);
    }

    /**
     * 新增网元-业务-eline-uni-l2
     * 
     * @param elementBusiElineUnil2 网元-业务-eline-uni-l2
     * @return 结果
     */
    @Override
    public int insertElementBusiElineUnil2(ElementBusiElineUnil2 elementBusiElineUnil2)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiElineUnil2.getId())) {
            elementBusiElineUnil2.setId(uuid);
        }
        elementBusiElineUnil2.setCreateBy(SecurityUtils.getUsername());
        elementBusiElineUnil2.setCreateTime(DateUtils.getNowDate());
        elementBusiElineUnil2.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineUnil2.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineUnil2Mapper.insertElementBusiElineUnil2(elementBusiElineUnil2);
    }

    /**
     * 修改网元-业务-eline-uni-l2
     * 
     * @param elementBusiElineUnil2 网元-业务-eline-uni-l2
     * @return 结果
     */
    @Override
    public int updateElementBusiElineUnil2(ElementBusiElineUnil2 elementBusiElineUnil2)
    {
        elementBusiElineUnil2.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineUnil2.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineUnil2Mapper.updateElementBusiElineUnil2(elementBusiElineUnil2);
    }

    /**
     * 批量删除网元-业务-eline-uni-l2
     * 
     * @param ids 需要删除的网元-业务-eline-uni-l2主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineUnil2ByIds(String[] ids)
    {
        return elementBusiElineUnil2Mapper.deleteElementBusiElineUnil2ByIds(ids);
    }

    /**
     * 删除网元-业务-eline-uni-l2信息
     * 
     * @param id 网元-业务-eline-uni-l2主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineUnil2ById(String id)
    {
        return elementBusiElineUnil2Mapper.deleteElementBusiElineUnil2ById(id);
    }
}
